<template>
	<div class="my-goods" @click="$router.push(`/goods_comment/${goods.id}`)">
		<!-- 图片 -->
		<div class="img"><van-image class="images" fit="cover" :src="goods.img_url" /></div>
		<!-- 标题 -->
		<h2 class="title">{{ goods.title }}</h2>
		<!-- 信息 -->
		<div class="info">
			<!-- 价格 -->
			<div class="price">
				<!-- 售价 -->
				<span class="now">￥{{ goods.sell_price }}</span>
				<s class="origin">￥{{ goods.market_price }}</s>
			</div>
			<div class="bottom">
				<span>热卖中</span>
				<span>剩{{ goods.stock_quantity }}件</span>
			</div>
		</div>
	</div>
</template>

<script>
export default {
	props: {
		goods: Object
	}
};
</script>

<style scoped lang="less">
.my-goods {
	padding: 3px;
	width: 170px;
	// background-color: pink;
	border: 1px solid #ccc;
	border-radius: 5px;
	box-shadow: inset 1px 1px 5px 0px rgba(45, 44, 44, 0.17);
}
.img {
	width: 170px;
	height: 170px;
	.images {
		width: 170px;
		height: 170px;
	}
}
.title {
	width: 100%;
	font-size: 12px;
	color: #000;
	height: 40px;
	display: flex;
	align-items: center;
	line-height: 1.5;
}
.info {
	background-color: #f0f0f0;
	width: 100%;
	height: 60px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 3px;
	box-sizing: border-box;
	font-size: 12px;
	.price {
		flex: 2;
		display: flex;
		margin-top: 10px;
		.now {
			color: red;
			font-size: 15px;
			margin-right: 20px;
		}
	}
	.bottom {
		flex: 1;
		display: flex;
		align-items: flex-end;
		width: 95%;
		justify-content: space-between;
	}
}
</style>
